<?php /*a:2:{s:71:"C:\Users\Administrator\Desktop\kitecms\app\admin\view\system\index.html";i:1572833562;s:72:"C:\Users\Administrator\Desktop\kitecms\app\admin\view\common\header.html";i:1572833562;}*/ ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<style>
    .layui-form-item .layui-input-inline {
        max-width: 80%;
        width: auto;
        min-width: 260px;
    }
    .layui-form-item .layui-form-label {
        width: 130px;
        text-align: right;
    }
</style>
<div class="x-body">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">基础配置</li>
            <li>上传设置</li>
        </ul>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item layui-show">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站域名</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="site_domain" value="<?php echo htmlentities($config['site_domain']); ?>" autocomplete="off" placeholder="请填写网站域名">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站名称</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="site_name" value="<?php echo htmlentities($config['site_name']); ?>" autocomplete="off" placeholder="请填写网站名称">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站LOGO</label>
                        <div class="layui-input-inline upload">
                            <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image" lay-data="{ exts:'jpg|png|gif|jpeg|ico', accept:'image'}">请上传网站LOGO</button>
                            <input type="hidden" class="upload-input" name="site_logo" value="<?php echo htmlentities($config['site_logo']); ?>">
                            <?php if($config['site_logo']): ?>
                            <img src="<?php echo htmlentities($config['site_logo']); ?>" style="border-radius:5px;border:1px solid #ccc" width="36" height="36">
                            <?php else: ?>
                            <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站图标</label>
                        <div class="layui-input-inline upload">
                            <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image" lay-data="{ exts:'jpg|png|gif|jpeg|ico', accept:'image'}">请上传网站图标</button>
                            <input type="hidden" class="upload-input" name="site_favicon" value="<?php echo htmlentities($config['site_favicon']); ?>">
                            <?php if($config['site_favicon']): ?>
                            <img src="<?php echo htmlentities($config['site_favicon']); ?>" style="border-radius:5px;border:1px solid #ccc" width="36" height="36">
                            <?php else: ?>
                            <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站标题</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="site_title" value="<?php echo htmlentities($config['site_title']); ?>" autocomplete="off" placeholder="请填写网站标题">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站关键词</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="site_keywords" value="<?php echo htmlentities($config['site_keywords']); ?>" autocomplete="off" placeholder="请填写网站关键词">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">网站描述</label>
                        <div class="layui-input-inline">
                            <textarea rows="6" class="layui-textarea" name="site_description" autocomplete="off" placeholder="请填写网站描述"><?php echo htmlentities($config['site_description']); ?></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">ICP备案信息</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="site_icp" value="<?php echo htmlentities($config['site_icp']); ?>" autocomplete="off" placeholder="请填写ICP备案信息">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">站点统计代码</label>
                        <div class="layui-input-inline">
                            <textarea rows="6" class="layui-textarea" name="site_statis" autocomplete="off" placeholder="请填写站点统计代码"><?php echo htmlspecialchars_decode($config['site_statis']); ?></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"> </label>
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">文件上传大小限制</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_file_size" value="<?php echo htmlentities($config['upload_file_size']); ?>" autocomplete="off" placeholder="请填写文件上传大小限制">
                        </div>
                        <div class="layui-form-mid layui-word-aux">单位：KB，0表示不限制大小</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">允许上传文件格式</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_file_ext" value="<?php echo htmlentities($config['upload_file_ext']); ?>" autocomplete="off" placeholder="请填写允许上传文件格式">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">图片上传大小限制</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_image_size" value="<?php echo htmlentities($config['upload_image_size']); ?>" autocomplete="off" placeholder="请填写图片上传大小限制">
                        </div>
                        <div class="layui-form-mid layui-word-aux">单位：KB，0表示不限制大小</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">允许上传图片格式</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_image_ext" value="<?php echo htmlentities($config['upload_image_ext']); ?>" autocomplete="off" placeholder="请填写允许上传图片格式">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">阿里云oss appid</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_oss_appid" value="<?php echo htmlentities($config['upload_oss_appid']); ?>" autocomplete="off" placeholder="请填写阿里云oss appid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">阿里云oss appsecret</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_oss_appsecret" value="<?php echo htmlentities($config['upload_oss_appsecret']); ?>" autocomplete="off" placeholder="请填写阿里云oss appsecret">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">阿里云oss endpoint</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_oss_endpoint" value="<?php echo htmlentities($config['upload_oss_endpoint']); ?>" autocomplete="off" placeholder="请填写阿里云oss endpoint">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">阿里云oss bucket</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="upload_oss_bucket" value="<?php echo htmlentities($config['upload_oss_bucket']); ?>" autocomplete="off" placeholder="请填写阿里云oss bucket">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开启oss</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="upload_oss_open" lay-skin="switch" <?php if($config['upload_oss_open'] == 1): ?>checked<?php endif; ?> lay-text="ON|OFF">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"> </label>
                        <div class="layui-input-block">
                            <input type="hidden" name="is_upload" value="1">
                            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>

    layui.use(['form', 'laydate', 'upload','element'], function() {
        var $ = layui.jquery, laydate = layui.laydate, layer = layui.layer, upload = layui.upload,element = layui.element,form = layui.form;
        upload.render({
            elem: '.layui-upload',
            url: "<?php echo url('@admin/common/uploadImages'); ?>"
            ,method: 'post'
            ,before: function(input) {
                layer.msg('文件上传中...', {time:3000000});
            },done: function(res, index, upload) {
                var obj = this.item;
                if (res.success) {
                    layer.closeAll();
                    var input = $(obj).parents('.upload').find('.upload-input');
                    if ($(obj).attr('lay-type') == 'image') {
                        input.siblings('img').attr('src', res.data.url).show();
                    }
                    input.val(res.data.url);
                }
                layer.msg(res.msg);
                return false;

            }
        });
        // 日期渲染
        form.on('submit(formSubmit)', function(data){
            if (data.field.is_upload == 1){
                if (data.field.upload_oss_open){
                    data.field.upload_oss_open = 1;
                }else{
                    data.field.upload_oss_open = 0;
                }
            }
            var load = layer.load(1);
            $.post("<?php echo url('index'); ?>",data.field,function (res) {
                if (res.success){
                    layer.msg(res.msg,{icon:1},function () {
                        window.location.reload();
                    })
                } else{
                    layer.close(load);
                    layer.msg(res.msg,{icon:2})
                }
            });
            return false;
        });
    });
</script>
</body>

</html>